<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .father {
        width: 400px;
        height: 400px;
        background-color: pink;
        margin: 100px;
      }

      .son {
        width: 200px;
        height: 200px;
        background-color: green;
      }
    </style>
  </head>
  <body>
    <div class="father">
      <div class="son"></div>
    </div>
    <script src="js/jquery.min.js"></script>
    <script>
      // mouseenter: 如果进入了父元素，再次进去子元素的时候不会重复的触发该事件
      // mouseover:  进入到父元素，经过子元素的时候会重复的触发该事件
      $('.father').on('mouseenter', function () {
        console.log('father触发了')
      })
      $('.son').on('mouseenter', function () {
        console.log('.son触发了')
      })

      setInterval(function () {
        $('.son').mouseenter()
      }, 1000)
    </script>
  </body>
</html>
